import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);

export default {
  path: '/order',
  component: Layout,
  name: 'orderManage',
  meta: {title: '订单管理', icon: 'icon', roles: [1, 2, 3, 4, 5, 6, 7, 8]},
  children: [
    {
      path: 'list',
      component: _import('order/list'),
      name: 'order',
      meta: {
        title: '订单列表',
        buttons: {
          detail: { label: '订单详情', enabled: true },
          detailBoxRefund: { label: '箱起订单退款', enabled: true },
          detailNotBoxRefund: { label: '非箱起订单退款', enabled: true },
          detailStateModify: { label: '订单状态修复', enabled: true },
          export: { label: '导出', enabled: true },
          openTax: { label: '查看发票', enabled: true },
          applyTax: { label: '申请发票', enabled: true }
        }
      },
    },
    {
      path: 'detail',
      component: _import('order/detail'),
      name: 'orderDetail',
      meta: {
        title: '订单详情', noCache: true, index: '/order/list',
        buttons: {
          boxRefund: { label: '箱起订单退款', enabled: true },
          notBoxRefund: { label: '非箱起订单退款', enabled: true },
          stateModify: { label: '订单状态修复', enabled: true }
        }
      },
      hidden: true,
      props: true
    },
    {
      path: 'invoice',
      component: _import('order/invoice'),
      name: 'invoiceTax',
      meta: {title: '申请发票', noCache: true, },
      props: true,
      hidden: true,
      buttons: {
        save: { label: '保存', enabled: true }
      }
    },
    {
      path: 'detailOld',
      component: _import('order/detailOld'),
      name: 'orderDetailOld',
      meta: {title: '旧订单详情', noCache: true, index: '/order/list'},
      hidden: true,
      props: true
    },
    {
      path: 'merchantOrder/list',
      component: _import('order/merchantOrder/list'),
      name: 'merchantOrder',
      meta: {
        title: '商家订单列表',
        buttons: {
          detail: { label: '订单详情', enabled: true },
          export: { label: '导出', enabled: true }
        }
      }
    },
    {
      path: 'merchantOrder/detail/:merchantId/:id',
      component: _import('order/merchantOrder/detail'),
      name: 'merchantOrderDetail',
      meta: {title: '商家订单详情', noCache: true, index: '/order/merchantOrder/list'},
      hidden: true,
      props: true
    },
    {
      path: 'refund/list',
      component: _import('order/refund/list'),
      name: 'refund',
      meta: {
        title: '退单列表'/* ,
        buttons: {
          detail: { label: '退单详情', enabled: true }
        } */
      }
    },
    {
      path: 'refund/detail/:id',
      component: _import('order/refund/detail'),
      name: 'refundDetail',
      meta: { title: '退单详情', noCache: true, index: '/order/refund/list' },
      hidden: true,
      props: true
    },
    {
      path: 'fixed',
      component: _import('order/orderFixed'),
      name: 'orderFixed',
      meta: { title: '错误订单修复' }
    }/*,
    {
      path: 'bond/list',
      component: _import('order/bond/list'),
      name: 'bondList',
      meta: {title: '保证金列表'},
    }*/
  ]
}
